import Vue from 'vue'

import 'normalize.css/normalize.css' 

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon

import '../src/assets/icon/iconfont.css'
import '@/styles/global.scss'
import VCharts from 'v-charts'
Vue.use(VCharts)


// import '../src/libs/sdk/neplayer.min.css'
// import '../public/sdk/neplayer.min.js'



//播放器
import VideoPlayer from 'vue-video-player'
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
Vue.use(VideoPlayer)


import '@/permission' // permission control


// console.log(router.options.routes)


// 自动化
let Modules = [
  require.context('./components/Chart', true, /\.vue$/),
  require.context('./components/table', true, /\.vue$/),
  require.context('./components/card', true, /\.vue$/),
  require.context('./components/FilterFrom', true, /\.vue$/),
]
Modules.forEach(el=>{
  el.keys().forEach(fileName => {
    const componentConfig = el(fileName);
    const componentName = fileName.replace(/^\.\//,'').replace(/\.vue$/,'');
    const component = Vue.component(
        componentName.replace(/\//,'-'),
        componentConfig.default || componentConfig
    )
  })
})



// set ElementUI lang to EN
Vue.use(ElementUI, { locale })

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
